import request from '@/utils/request'

// 查询楼盘信息列表
export function listInfo(query) {
  return request({
    url: 'roomInfo/roomInfo/list',
    method: 'get',
    params: query
  })
}
// 查询楼盘信息列表
export function premisesListInfo(query) {
  return request({
    url: 'house/house/list',
    method: 'get',
    params: query
  })
}

// 查询楼盘信息详细
export function getInfo(recommended) {
  return request({
    url: '/house/house/' + recommended,
    method: 'get'
  })
}

// 新增楼盘信息
export function addInfo(data) {
  return request({
    url: '/house/house',
    method: 'post',
    data: data
  })
}

// 修改楼盘信息
export function editRecommended(data) {
  return request({
    url: 'roomInfo/roomInfo/editRecommended',
    method: 'put',
    data: data
  })
}

//楼盘特色
export function getList(data) {
  return request({
    url: 'roomInfo/roomInfo/roomAvailabilityFigure',
    method: 'put',
    data: data
  })
}

//商圈
export function businessCircle(code) {
  return request({
    url: 'house/house/businessCircle/'+code,
    method: 'get',
  })
}
//地铁
export function subwayListById(city) {
  return request({
    url: 'house/house/subwayListById/'+city,
    method: 'get',
  })
}


//获取公共配套
export function getPublicFacility() {
  return request({
    url: 'roomInfo/roomInfo/getPublicFacility',
    method: 'get',
  })
}

//获取私有配套
export function getPrivateFacility() {
  return request({
    url: 'roomInfo/roomInfo/getPrivateFacility',
    method: 'get',
  })
}


//获取管家
export function getManager() {
  return request({
    url: 'roomInfo/roomInfo/getManager',
    method: 'get',
  })
}


//添加集中式房源
export function saveCentralization(data) {
  return request({
    url: 'roomInfo/roomInfo/saveCentralization',
    method: 'put',
    data: data
  })
}

//添加分散式房源
export function saveDistributed(data) {
  return request({
    url: 'roomInfo/roomInfo/saveDistributed',
    method: 'put',
    data: data
  })
}


//楼盘特色
export function updatePublishStatus(data) {
  return request({
    url: 'roomInfo/roomInfo/updatePublishStatus',
    method: 'put',
    data: data
  })
}

// 删除楼盘信息
export function delInfo(id) {
  return request({
    url: '/house/house/' + id,
    method: 'delete'
  })
}
// 地区联动
export function getRegionList(parentId) {
  return request({
    url: '/house/house/region/' + parentId,
    method: 'get'
  })
}
//楼盘特色
export function getPremisesProperty() {
  return request({
    url: '/house/house/getPremisesProperty',
    method: 'get'
  })
}


